package com.jsits.v2x.bx05;

import com.jsits.framework.core.config.CoreConfig;
import com.jsits.framework.core.config.WebMvcConfig;
import com.jsits.v2x.bx05.config.Bx05Config;
import org.springframework.boot.Banner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;
import org.springframework.scheduling.annotation.EnableScheduling;

/**
 * 入口类, 扫描并注入其他配置类和服务
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
@Import({Bx05Config.class, CoreConfig.class, WebMvcConfig.class})
@EnableScheduling
public class Application extends SpringBootServletInitializer {
	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
		return configureApplication(builder);
	}

	public static void main(String[] args) throws Exception {
		configureApplication(new SpringApplicationBuilder()).run(args);
	}

	private static SpringApplicationBuilder configureApplication(SpringApplicationBuilder builder) {
		return builder.sources(Application.class).bannerMode(Banner.Mode.OFF).web(true);
	}

}
